Rod pump control system including parameter estimator

ABSTRACT

A rod pump control system includes a parameter estimator that determines from motor data parameters relating to operation of the rod pump and/or downhole dynamometer card without the need for external instrumentation, such as down hole sensors, rod load sensors, flow sensors, acoustic fluid level sensors, etc. In one embodiment, instantaneous motor current and voltage together with pump parameters are used in determining rod position and load. The rod position and load are used to control the operation of the rod pump to optimize the operation of the pump. Also disclosed in a pump stroke amplifier that is capable of increasing pump stroke without changing the overall pumping speed, or in the alternative, maintaining the well output with decreased overall pumping speed.

CROSS REFERENCE TO RELATED APPLICATIONS

[0001] This application claims priority of provisional applicationserial No. 60/414,197, entitled “Rod Pump Control System IncludingParameter Esitmator”, which was filed on Sep. 27, 2002, and provisionalapplication serial No. 60/429,158, entitled “Sensorless Control SystemFor Progressive Cavity and Electric Submersible Pumps”, which was filedon Nov. 26, 2002, and is related to application serial number entitled“Control System For Progressing Cavity Pump”, which was filed on Sep. 5,2003, and application serial number entitled “Control System ForCentrifugal Pumps”, which was filed on Sep. 5, 2003, which was filed onSep. 5, 2003, which four patent applications are hereby incorporatedherein by reference.

BACKGROUND OF THE INVENTION Field of the Invention

[0002] The present invention relates generally to control of rod pumpsfor oil and gas wells, and in particular to methods for optimizing theoperation of rod pumps using parameter estimation.

[0003] The load upon and position of the rods that drive downhole pumpsare important parameters for control, monitoring, and protection of theartificial lift system used in oil and gas production. Existing methodsof measuring these parameters involve the mounting and use of externalinstruments such as strain gauges, load cells, and position transducers.The need for these additional devices increases the cost and complexityof the pumping system and reduces system reliability. Generally, ACinduction motors drive rod pumping systems.

[0004] One method for determining rod load or force is disclosed in U.S.Pat. No. 4,490,094 (the '094 patent). With this method, motor velocityis determined during a complete or predetermined portion of areciprocation cycle and the results are used to compute one or moreparameters of pumping unit performance.

[0005] However, determination of rod load PRL_(i) on an ith revolutionof the prime mover rotor depends on knowing the position of crank forcomputation of a torque factor TFi according to the equation (1):$\begin{matrix}{{PRLi} = \frac{{n.{Ti}} + {m.{\sin \left( {\phi_{i} + \beta} \right)}} - {RIT} + {AIT}}{TFi}} & (1)\end{matrix}$

[0006] Because the torque factor TFi appears in the denominator of theequation, special care must be taken in deriving the torque factorTf_(i) and in using it in the computation to avoid dividing by zero orby small numbers that would distort the result. Moreover, the '094patent does not disclose how to estimate crank position.

[0007] U.S. Pat. No. 5,252,031 (the '031 patent) discloses a method formonitoring a rod pumped well to detect various problems. The method usesmeasurements made at the surface to calculate a downhole pumpdynamometer card. This downhole pump dynamometer card is useful indetecting various pump problems and controlling the pumping unit. Themethod involves finding rod position from motor revolutions, a referenceswitch and pump geometry. This method requires setting up look-uptables.

[0008] In addition, the methods disclosed in both the '031 patent andthe '094 patent employ a sensor to detect a rotation of the motor shaft.Because of the ratio between motor and pump rotations, this method canproduce numerous sample points per stroke of the pump. However, the timebetween motor revolutions to get motor velocity as well as sample otherparameters, such as motor current, is a function of pump speed and isnot suitable for precise monitoring of the pump operation. In addition,the method of determining motor torque relies on a look-up table ofsteady-state motor operation rather than a true dynamic calculation oftorque. These methods would work fine for providing simple pump controlfunction, such as shutting down the pump when it is pumped off. However,these methods would not be suitable for real time closed-loop pumpcontrol, such as rod load limiting, that requires a high bandwidthfeedback signal.

[0009] Past work involving the analysis of rod pump systems can bedivided into two categories. One such category involves predicting theperformance of a rod pump unit by calculating surface load from knownsurface position and assumed pump load. An example of this method forderiving the surface dynamometer card from the downhole dynamometer cardis disclosed in an article entitled “Predicting the Behavior ofSucker-Rod Pumping Systems”, by S. G. Gibbs, in JPT, July 1963, pages769-78, Trans, AIME 228. This uses a multisection model of the rodstring to simulate the pump operation.

[0010] The other category deals with the diagnosis of existing pumpinginstallations by determining actual pump conditions from measuredsurface conditions. U.S. Pat. No. 3,343,409 discloses a method forestimating the downhole dynamometer card from the surface dynamometercard using frequency based Fourier analysis. However, this methodrequires a large number of coefficients to accurately model the highfrequency components that produce the corners of the dynamometer card.In addition, the method relies on external sensors for polished rod loadand position.

[0011] The average output flow rate of a sucker rod pump is a functionof the downhole pump stroke and the average speed of the pump. Withexisting technologies, the downhole stroke of the pump is dictated bythe speed of the pumping unit and the given characteristics of thepumping unit geometry and the sucker rod stiffness. Significant stretchin the sucker rod, particularly for deep wells, reduces the amount ofsurface rod stroke that can be delivered to the downhole pump.Additionally, the speed of the pumping operation is often limited by theneed to avoid overstressing the sucker rod and/or the pumping unitgearbox. Therefore, output flow rate is constrained by the imposed pumpstroke and stroking rate.

SUMMARY OF THE INVENTION

[0012] The disadvantages and limitations of the background art discussedabove are overcome by the present invention. With this invention, thereis provided a method of continuously determining operational parametersof a rod pump used in oil and gas production, wherein the rod pumpincludes a rod string carrying a downhole pump, the rod string includinga polished rod, and a drive system including an AC electrical drivemotor having a rotor coupled to the rod string through a transmissionunit. The method comprises the steps of continuously measuring theelectrical voltages applied to the drive motor to produce electricalvoltage output signals; continuously measuring the electrical currentsapplied to the drive motor to produce electrical current output signals;deriving values of instantaneous electrical torque from the electricalvoltage output signals and the electrical current output signals;deriving values of instantaneous motor velocity from the electricalvoltage output signals and the electrical current output signals; andusing geometry of the rod pumping unit and one of the instantaneousvalues to calculate instantaneous values of an operating parameter ofthe rod pump. In one embodiment, the method is used for calculating rodload and/or rod position of a rod pump. The method also providescalculations of other pump parameters such as gearbox torque and pumpstroke that are useful in protecting the pumping mechanism anddiagnosing pump problems.

[0013] The invention provides a method of deriving operating parameters,such as rod load and position, from the drive motor and pumping unitparameters without the need for external instrumentation such as downhole sensors, acoustic fluid level sensors, flow sensors, etc. Themethod provides nearly instantaneous readings of motor velocity andtorque which can be used for both monitoring and real-time, closed-loopcontrol of the rod pump. In addition, American Petroleum Institutespecification geometry and system identification routines are used toestablish parameters used in calculating the performance parameters thatare used in real time closed loop control of the operation of the rodpump, obviating the need to create large look-up tables for parametervalues used in calculating performance parameters. Simple parametersdefining the special geometry used in belt driven pumping units are alsoincluded in the control.

[0014] In one embodiment, wherein the first and second operatingparameters are instantaneous position and load of the polished rod, themethod includes the steps of using the estimated values of position andload for the polished rod to obtain a surface dynamometer card for therod pump, and deriving from the surface dynamometer card theinstantaneous position and load of the downhole pump for pump controland/or generation of a downhole dynamometer card for the pump.

[0015] The parameter estimator reduces the cost and complexity of rodpumping systems and provides rod load measurement accuracy superior tosystems using sensors such as strain gages and load cells. Moreover,this eliminates wires to sensors mounted on moving portions of the pumpand reliability issues related to the sensors and their associatedwiring.

[0016] Further in accordance with the invention, the parameter estimatorproduces values of rod pump parameters which can be used in optimizingthe operation of the rod pump. Thus, in accordance with a further aspectof the invention, there are provided several methods of controlling therod load and/or flow rate of a rod pump used in oil and gas productionand/or preventing damage to the pump assembly, wherein the rod pumpincludes a rod string including a polished rod and a drive systemincluding an AC electrical motor having a rotor that is coupled througha transmission unit to the rod string for reciprocating a downhole pump.

[0017] One method for rod load control uses the computed rod load tocontrol the force in the rod and thereby prevent damage to the rodstring due to excessive tension or compression of the sucker rod.Increased pump speeds will typically produce large tensile forceexcursions on the up stroke and large compressive forces on thedownstroke. The method limits those excursions to preset limits bymanipulating the pumping speed. A second aspect of the method providesfor intentionally increasing or decreasing rod load during certainportions of the pump cycle to increase pump stroke and associated fluidproduction.

[0018] Another method of rod pump control provides for the use of amodel of the rod string to derive a factor for modulating pump speedthat reduces rod peak loads, damps rod force excursions, reduces gearboxtorque loading, increases pump stroke, and improves energy efficiencywithout the need for external rod load and position sensors. Severalembodiments of this method use somewhat different models for control ofthe pump. Those models include the use of rod load and/or rod positionto generate control signals that manipulate pump operation.

[0019] The rod pump control method comprises the steps of obtaining ameasure of the velocity of the polished rod in real-time; obtaining ameasure of polished rod load in real-time; obtaining an estimate of thevelocity of the pump in real-time; deriving a modulating factor from thedifference between the velocity of the polished rod and the estimatedpump velocity; and using the modulating factor to modulate motor speedto cause the downhole pump to more closely follow the polished rodposition without excessive excursions in rod load.

[0020] The invention allows the stroke of the downhole pump to beincreased without an increase in overall average pumping speed. Thisincreases well fluid production without increasing overall pumping speedand enables increased output in wells that are running at maximumphysical capacity of the pumping system. Alternatively, the method canmaintain well output with decreased overall pumping speed, reduced rodstress fluctuation, and improved energy efficiency.

[0021] In accordance with a further aspect of the invention, there isprovided a system for continuously determining operating parameters of arod pump used in oil or gas production, the rod pump including a rodstring carrying a downhole pump driven by an electrical drive motor thatis coupled to the rod string through a transmission unit. The systemcomprises means for determining the torque and velocity inputs to therod pump, means for using the torque and velocity inputs to calculateone or more values representing the performance of the rod pump, andmeans for using parameters related to the geometry of the rod pump andat least one of said performance values to calculate values of at leastone operating parameter of the rod pump.

[0022] The rod pump control reduces peak rod loads, prevents compressiverod forces, and dampens rod load oscillations thereby reducing rodfatigue and rod failure. In addition, the rod pump control reduces peakpump velocity, resulting in less power lost to viscous pump friction,increasing pumping efficiency and reducing pump wear. Moreover, internalfrictional losses in the rod are reduced by damping rod oscillations,thereby increasing pumping efficiency.

DESCRIPTION OF THE DRAWINGS

[0023] These and other advantages of the present invention are bestunderstood with reference to the drawings, in which:

[0024]FIG. 1 is a simplified representation of a rod pump systemincluding a rod pump control system that includes a parameter estimatorin accordance with the present invention;

[0025]FIG. 2 is a block diagram of the rod pump control system of FIG.1;

[0026]FIG. 3 is a block diagram of the parameter estimator of the rodpump control system for calculating values including gearbox torque,polished rod load, and rod position using parameters of the drive motorand rod pumping unit in accordance with the present invention;

[0027]FIG. 4 is a block diagram of a process for obtaining an estimateof rotary weight torque for the process of FIG. 3;

[0028]FIG. 5 is a block diagram of a process for obtaining an estimateof total reflected inertia for the process of FIG. 3;

[0029]FIG. 6 is a block diagram of a process for obtaining an estimateof rod load for the process of FIG. 3;

[0030]FIG. 7 is a block diagram of a process for selecting rod strokeregions that have torque factors of sufficient magnitude to produceaccurate measurement of rod load as the rod load windowing of FIG. 3;

[0031]FIG. 8 is a process flow chart for calculating polished rod loadand rod position for the pump system of FIG. 1, in accordance with thepresent invention;

[0032]FIG. 9 illustrates a simulated surface and downhole dynamometercard for a conventional beam pump as well as a downhole dynamometer cardgenerated by the wave method of computation;

[0033]FIG. 10 illustrates simulated surface and downhole dynamometercards for a conventional beam pump from a commercially available rodpump simulation program;

[0034]FIG. 11 illustrates a measured surface dynamometer card for a beltdriven pump as well as a downhole dynamometer card generated by the wavemethod of computation;

[0035]FIG. 12 illustrates simulated surface and downhole dynamometercards for a belt driven pump from a commercially available rod pumpsimulation program;

[0036]FIG. 13 is a block diagram of a system for estimation of rod pumpsurface and downhole dynamometer cards for the rod pumping unit inaccordance with the present invention;

[0037]FIG. 14 is a block diagram of a rod load control in accordancewith the present invention;

[0038]FIG. 15 is a block diagram of a single section simulation modelbased rod pump control in accordance with the present invention;

[0039]FIG. 16 is a block diagram of a multisection simulation modelbased rod pump control in accordance with the present invention;

[0040]FIG. 17 is a block diagram of a wave equation based rod pumpcontrol in accordance with the present invention;

[0041]FIG. 18 is a process flow chart for producing rod pump control forimproved operation of the rod pump system of FIG. 1.

[0042]FIG. 19 is a surface dynamometer card for a beam pump runningwithout rod pump control;

[0043]FIG. 20 is a surface dynamometer card for a beam pump running withrod pump control;

[0044]FIG. 21 is a downhole dynamometer card for a beam pump runningwithout rod pump control;

[0045]FIG. 22 is a downhole dynamometer card for a beam pump runningwith rod pump control;

[0046]FIG. 23 is a graph showing pump velocity as a function of time fora beam pump running without rod pump control;

[0047]FIG. 24 is a graph showing pump velocity as a function of time fora beam pump running with rod pump control; and

[0048]FIG. 25 is a block diagram of a processor of the rod pump controlsystem of FIG. 2.

DEFINITIONS OF TECHNICAL TERMS

[0049] The following are definitions of some of the technical terms usedin the detailed description of the preferred embodiments.

[0050] Beam Weight (Wb): The equivalent weight of the beam that is usedto calculate its articulating inertia.

[0051] Counterweight Angle (At): The angle of the crank counterweightoffset.

[0052] Counterweight Inertia (Jc): The effective inertia of thecounterweight.

[0053] Crank Angle (Ac) The angular position of the beam pump crankshaftat the output of the reduction gearbox with respect to a referencepoint.

[0054] Crank Velocity (Wc): The change in crank angle as a function oftime. The time derivative of the crank angle.

[0055] Downhole Pump Velocity (Vp): The velocity of the downhole pump asdetermined by the rod string/pump simulation algorithm.

[0056] Electrical Torque (Te): The torque generated at the motor shaftas determined from the motor voltages and currents.

[0057] Excitation Frequency (We): The fundamental frequency of theinstantaneous current circulating in the drive motor.

[0058] Gearbox Output Torque (Tn): The torque at the output of thegearbox.

[0059] Motor Inertia (Jm): The inertia of the motor and associatedcomponents rotating at the motor speed.

[0060] Motor Velocity (Wr): The feedback velocity of the motor asdetermined from the motor voltages and currents.

[0061] Overall Gear Ratio (Ng): The gearing reduction between the motoroutput shaft and the crank shaft of the pumping unit. The pumping unitgear ratio.

[0062] Rod Load (Fr): The load applied to the polished rod as determinedby the motor torque, pumping unit geometry, and pumping systemparameters.

[0063] Rod Position (Xr): The position of the polished rod as determinedby the motor position and the pumping unit geometry.

[0064] Rod Velocity (Vr): The velocity of the polished rod as determinedby the motor velocity and the pumping unit geometry.

[0065] Rotary Weight Torque (Tr): The torque component seen at the gearbox output shaft due to the counterweight normal force.

[0066] Torque Command (Tc): The final torque command to the drive systemcontrolling the pump motor.

[0067] Torque Factor (Tf): A factor that, when multiplied by the load atthe polished rod, gives the torque at the crankshaft of the pumping unitreducer.

[0068] Total Reflected Inertia (Jt): The inertia seen at the motor shaftconsisting of motor inertia and associated high speed components and thereflected inertias of the counterweight mass and beam mass.

[0069] Unbalanced Force (Bu): The force that would be required to bringthe beam of the pumping unit to a horizontal position if the unit had nocounterbalance.

[0070] Velocity Request (Wx): The pumping unit prime mover operatorrequested run speed.

[0071] Velocity Command (Wy): The pumping unit prime mover commandvelocity. This signal is a conditioned version of the operator requestedrun speed, and originates in the drive control software.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0072] Referring to FIG. 1, there is shown a rod pump system 20, theoperation of which is controlled by a rod pump control system and methodincluding a parameter estimator in accordance with the presentinvention. For purposes of illustration, the rod pump control system 21is described with reference to an application in a rod pump system 20that includes a conventional beam pump. The beam pump has a walking beam22 that reciprocates a rod string 24 that includes a polished rodportion 25. The rod string 24 is suspended from the beam for actuating adownhole pump 26 that is disposed at the bottom of a well 28. However,the rod pump control system and method provided by the invention areapplicable to any system that uses an electric motor to reciprocate arod string, including those that drive the rod through belt or chaindrives. For example, a belt driven pumping unit includes a belt that iscoupled to a rod string for reciprocating the rod string verticallywithin a well as the belt is driven by a motor.

[0073] The walking beam 22, in turn, is actuated by the pitman arm 31which is reciprocated by a crank arm 30 driven by an electric motor 32that is coupled to the crank arm 30 through a gear reduction mechanism,such as gearbox 34. The typical motor 32 can be a three-phase ACinduction motor operable at 460 VAC and developing 10-125 horsepower,depending upon the capacity and depth of the pump. Other types of motorssuch as synchronous motors can be used to drive the pumping unit. Thegearbox 34 converts motor torque to a low speed but high torque outputfor driving the crank arm 30. The crank arm 30 is provided with acounterweight 36 that serves to balance the rod string 24 suspended fromthe beam 22 in the manner known in the art. Counterbalance can also beprovided by an air cylinder such as those found on air-balanced units.Belted pumping units may use a counterweight that run in the oppositedirection of the rod stroke or an air cylinder for counterbalance.

[0074] The downhole pump 26 is a reciprocating type pump having aplunger 38 attached to the end of the rod string 24 and a pump barrel 40which is attached to the end of tubing in the well 28. The plunger 38includes a traveling valve 42 and a standing valve 44 positioned at thebottom of the barrel 40. On the up stroke of the pump, the travelingvalve 42 closes and lifts fluid, such as oil and/or water, above theplunger 38 to the top of the well and the standing valve 44 opens andallows additional fluid from the reservoir to flow into the pump barrel40. On the down stroke, the traveling valve 42 opens and the standingvalve 44 closes in preparation of the next cycle. The operation of thepump 26 is controlled so that the fluid level maintained in the pumpbarrel 40 is sufficient to maintain the lower end of the rod string 24in the fluid over its entire stroke.

[0075] Referring to FIG. 2, which is a simplified representation of therod pump control system 21 including parameter estimator in accordancewith the present invention, the parameter estimator determinesparameters relating to operation of the rod pump from motor data withoutthe need for external instrumentation. In one embodiment, instantaneousmotor currents and voltages together with pump parameters are used indetermining rod position and load without the need for strain gauges,load cells, or position sensors as well as determining pump pressure andpump flow without the need for additional downhole or surface sensors.The rod position and load can be used to control the operation of thepump 26 to optimize the operation of the pump 26. In addition, AmericanPetroleum Institute (API) specifications have been used to define thepump geometry that allows the use of readily available data from pumpmanufacturers. System identification routines are used to establishinstallation dependent parameters specific to the particular pump usedin calculating performance parameters that are used in real-time closedloop control of the operation of the rod pump, obviating the need tocreate large look-up tables for parameter values used in calculatingperformance parameters.

[0076] The pump control system 21 includes transducers, such as currentand voltage sensors, to sense dynamic variables associated with motortorque and velocity. As shown in FIG. 2, current sensors 50 are coupledto a sufficient number of the motor leads for the type of motor used.The current sensors 50 provide voltages proportional to theinstantaneous stator currents in the motor 32. Voltage sensors 52 areconnected across to a sufficient number of the motor windings for thetype of motor used and provide voltages proportional to theinstantaneous voltages across the motor windings. The current andvoltage signals produced by sensors 50 and 52 are supplied to aprocessor 53 through suitable input/output devices 54. The processor 53further includes a processing unit 55 and storage devices 56 whichstores programs and data files used in calculating operating parametersand producing control signals for controlling the operation of the rodpump system 20. This control arrangement provides nearly instantaneousreadings of motor velocity and torque which can be used for bothmonitoring and real-time, closed-loop control of the rod pump. Forexample, in one embodiment, computations of motor velocity and torqueused for real-time, closed-loop control are provided at the rate of 1000times per second.

[0077] Motor currents and voltages are sensed to determine theinstantaneous electric power level drawn from the power source by theelectric motor operating the well pump. As the rod string 24 that drivesthe downhole pump 26 is raised and lowered during each cycle, the motor32 is cyclically loaded. Depending on the particular pump installationconfiguration, the walking beam 22 is at a known position during maximumand minimum motor loads. The timing of these maximums and minimums candefine the operational pumping frequency and, by integration of themotor velocity in light of the motor to crank gearing, it is possible toestimate the phase position of the pump crank at any time. By monitoringthe variances of the motor currents and voltages as a function of pumpcrank angle, the voltage and current variances can be used together withparameters related to pump geometry to calculate estimates of rodposition Xr and rod load Fr.

[0078] Referring to FIG. 3, there is shown a block diagram of aparameter estimator 23 of the rod pump control system 21 for calculatingestimates of parameters including rod position Xr, rod load Fr, andgearbox output torque Tn. In one preferred embodiment, the calculationis carried out by the processing unit 55 (FIG. 2) under the control ofsoftware routines stored in the storage devices 56. Block 62 responds tosignals corresponding to instantaneous values of motor current andvoltage to produce a measure of electrical torque Te of the drive motor32. Block 63 responds to the signals corresponding to instantaneousvalues of motor current and voltage to produce an estimate of velocityWr of the drive motor 32. Block 64 calculates rod position Xr and torquefactor Tf. Block 65 calculates an estimate of rod load Fr. Block 67calculates an estimate of rotary weight torque Tr. Block 68 calculatestotal reflected inertia Jt. Block 69 produces an output corresponding toacceleration Alpha of the drive motor shaft.

[0079] More specifically, blocks 62 and 63 can include hardware circuitswhich convert and calibrate the motor current and voltage signalsprovided by the sensors or transducers 50 and 52 (FIG. 2) into currentand flux signals. The hardware circuits scale and translate the currentand flux signals into an internal frame of reference. After scaling andtranslation, the outputs of the voltage and current sensors can bedigitized by an analog to digital converter. Block 62 combines thescaled signals with motor equivalent circuit parameters to produce aprecise measure of electrical torque Te. Automatic identificationroutings can be used to establish the motor equivalent circuitparameters. Block 63 combines the scaled signals with motor equivalentcircuit parameters to produce a precise measure of motor velocity Wr.

[0080] In one embodiment, the stator flux is calculated from motorvoltages and currents and the electromagnetic torque is directlyestimated from the stator flux and stator current. Three-phase motorvoltages and currents are converted to dq (direct/quadrature) framesignals using three to two phase conversion for ease of computation in amanner known in the art. Signals in the dq frame can be represented asindividual signals or as vectors for convenience. Block 62 responds tomotor stator voltage vector Vs and motor stator current vector Is tocalculate a measure of electrical torque Te produced by the motor. Inone embodiment, the operations carried out by block 62 for calculatingthe electrical torque estimate are as follows. The stator flux vector Fsis obtained from the motor stator voltage Vs and motor stator current Isvectors according to equation (2):

Fs=(Vs−Is.Rs)/s  (2)

Fds=(Vds−Ids.Rs)/s  (2A)

Fqs=(Vqs−Iqs.Rs)/s  (2B)

[0081] where Rs is the stator resistance and s (in the denominator) isthe Laplace operator for differentiation. Equation (2A) and (2B) showtypical examples of the relationship between the vector notation forflux Fs, voltage Vs, and current Is and actual d axis and q axissignals.

[0082] In one embodiment, the electrical torque Te is estimated directlyfrom the stator flux vector Fs obtained from equation (2) and themeasured stator current vector Is according to equation (3) or itsequivalent (3A):

Te=Ku.(3/2).P.FsxIs  (3)

Te=Ku.(3/2).P.(Fds.Iqs−Fqs.Ids)  (3A)

[0083] where P is the number of motor pole pairs and Ku is a unit scalefactor to get from MKS units to desired units.

[0084] In one embodiment, rotor velocity Wr is obtained from estimatesof electrical frequency We and slip frequency Ws. The inputs to block 63also are the stator voltage Vs and stator current Is vectors. Block 63calculates the motor velocity Wr. In one embodiment, the operationscarried out by block 63 for calculating the motor velocity are asfollows. A rotor flux vector Fr is obtained from the measured statorvoltage Vs and stator current Is vectors along with motor statorresistance Rs, stator inductance Ls, magnetizing inductance Lm, leakageinductance SigmaLs, and rotor inductance Lr according to equations (4)and (5); separate d axis and q axis rotor flux calculations are shown inequations (5A) and (5B) respectively:

SigmaLs=Ls−Lm{circumflex over ( )}2/Lr  (4)

then,

Fr=(Lr/Lm).[Fs−Is.SigmaLs]  (5)

Fdr=(Lr/Lm).(Fds−SigmaLs.Ids)  (5A)

Fqr=(Lr/Lm).(Fqs−SigmaLs.Iqs)  (5B)

[0085] The slip frequency Ws can be derived from the rotor flux vectorFr, the stator current vector Is, magnetizing inductance Lm, rotorinductance Lr, and rotor resistance Rr according to equation (6):$\begin{matrix}{{Ws} = {{Rr} \cdot \left( {{Lm}/{Lr}} \right) \cdot \frac{\left\lbrack {{{Fdr} \cdot {Iqs}} - {{Fqr} \cdot {Ids}}} \right\rbrack}{{{Fdr}^{\hat{}}2} + {{Fqr}^{\hat{}}2}}}} & (6)\end{matrix}$

[0086] The instantaneous excitation or electrical frequency We can bederived from stator flux according to equation (7): $\begin{matrix}{{We} = \frac{{{Fds} \cdot {sFqs}} - {{Fqs} \cdot {sFds}}}{{{Fds}^{\hat{}}2} + {{Fqs}^{\hat{}}2}}} & (7)\end{matrix}$

[0087] The rotor velocity or motor velocity Wr can be derived from theslip frequency Ws and the electrical frequency We according to equation(8):

Wr=We−Ws  (8)

[0088] The motor velocity Wr is passed through an amplifier 70 anddivided by the gain Ng which represents the overall gear ratio betweenthe motor and the pump crankshaft. Consequently, the motor velocity Wrthat has been obtained from motor voltage and current is converted tocrank velocity Wc, which reflects the overall pumping unit gear ratio,that is being produced at the output of the gearbox 34.

[0089] The crank velocity Wc is integrated in block 71 to obtain aposition which, when combined with the overall pumping unit gear and areference position, yields the angular position that is the crank angleAc of the pumping unit gearbox. The reference position can be obtainedusing a magnetic or optical sensing device, a cam limit switch, orsimilar device, to define a reference point within the stroke of thepumping unit for each cycle of operation.

[0090] Block 64 calculates the rod position Xr and the torque factor Tfusing the crank angle Ac obtained from the crank velocity Wc, andparameters associated with beam pump geometry. As is known, the geometryof the pumping unit is defined by the American Petroleum Institute andcan be entered directly into the control in that format. One source ofAPI specifications is API Specification 11E, entitled “Specification forPumping Units”, seventeenth edition, Nov. 1, 1994. Information enteredis dependent upon the class of the rod pump and direction of rotation.Typical beam pump parameters that are used for calculating the rodposition Xr include the dimensions of the walking beam, crank radius,and pitman arm as well as the location of the various pivot points inthe unit. Those pump parameters are readily available from pumping unitmanufacturers. Simple parameters are also included in the control forbelt type pump mechanisms that are not specified by the API standard.Automatic identification routings are used to establish installationdependent pumping unit parameters such as counterbalance inertia andfrictional terms.

[0091] Block 67 combines the crank angle Ac with the counterweight angleAt to produce an estimate of rotary torque Tr associated with the weightof the counterweight. Referring to FIG. 4, in one embodiment, the rotarytorque Tr is obtained by summing the crank angle Ac with thecounterweight angle At using summing block 72. Block 73 obtains the sineof the resultant value. The result is passed through amplifier 74, thegain −Mu of which is selected to correspond to the counterweight moment,producing the rotary torque Tr.

[0092] Referring to FIGS. 3 and 5, block 68 combines torque factor Tf,produced by block 64, beam weight Wb, counterweight inertia Jc and motorinertia Jm to produce total reflected inertia Jt. With reference to FIG.5, block 75 obtains the product of torque factor Tf and equivalent beamweight Wb. Torque factor Tf is entered twice to square that factor. Inone embodiment, the gain of amplifier 76 is 1/G which divides theproduct by the acceleration of gravity such that output of amplifier 76is the articulating inertia of the pumping unit. The result is combinedwith counterweight inertia Jc at the crank in summing block 77 andscaled by amplifier 78, the gain 1/Ng{circumflex over ( )}2 of which isselected to correspond to the inverse square of the overall gear ratio.The scaled value is combined with motor inertia Jm by summing block 79to obtain the estimate of total reflected inertia Jt.

[0093] Referring to FIGS. 3 and 6, block 65 combines electrical torqueTe calculated by block 62, rotary weight torque estimate Tr calculatedby block 67, an estimate of total reflected inertia Jt calculated byblock 68, motor acceleration estimate Alpha, produced by block 69,torque factor Tf from block 67, static friction Sf, crank velocity Wcfrom amplifier 70, viscous friction factor Bf, and unbalanced force Buto produce the rod load estimate Fr. With reference to FIG. 6, block 80obtains the product of motor acceleration estimate Alpha and an estimateof total reflected inertia Jt at the motor, the result of which issubtracted from the electrical torque Te by summing block 81. Thisdifference is scaled by a factor corresponding to the gearbox ratio Ng,using amplifier 82. The difference between electrical torque as modifiedby motor acceleration and load inertia factor, provided by amplifier 82minus the static torque Sf, provided by setup testing, and viscoustorque, provided by multiplying in amplifier 84 the crank speed Wc by aviscous friction factor Bf determined during setup, and rotary weighttorque Tr is divided by the torque factor Tf in block 85, and the resultis summed with unbalanced force Bu in summing block 86 to produce rodload estimate Fr. A rod load update enable switch 87 and memory element88 are used to hold the prior value of rod load at around the pointswhere the torque factor Tf goes to zero as determined by the rod loadupdate enable output of block 60 detailed in FIG. 7.

[0094] Referring to FIGS. 3 and 7, block 60 compares the rod position tothe positions defined by the ends of the rod stroke Sr determined duringsetup. If the rod position is within the deadzone Dz of either end ofthe stroke, the rod load update enable output is off and block 65 (FIG.6) is inhibited from updating the rod load Fr. Deadzone Dz is alsodetermined during setup. With reference to FIG. 7, relational operator89 compares the current value of rod position Xr to the rod loaddeadzone value Dz and outputs a logical true if Xr is greater than Dz.Summing block 90 subtracts the rod load deadzone value Dz from the rodstroke Sr. Relational operator 91 compares the current value of rodposition Xr to the output of summing block 90 and outputs a logical trueif Xr is the lesser value. Logical operator 92 outputs a logical trueonly if both relational operators 89 and 91 are outputting logicaltrues.

[0095] Referring again to FIG. 3, the gearbox output torque Tn can becomputed from the electrical torque Te produced by block 62 by using theoverall gearbox ratio. The value of electrical torque Te produced byblock 62 is multiplied by a factor related to gearbox ratio Ng, using anamplifier 66, to provide an estimate of gearbox output torque Tn.

[0096] Block 69 produces an output corresponding to acceleration Alphaof the drive motor shaft. One method to obtain motor acceleration inAlpha Block 69 is to differentiate the motor velocity Wr.

[0097] Multiplier block 61 produces an output corresponding to rodvelocity Vr by computing the product of torque factor Tf and crankvelocity Wc.

[0098] Referring to FIG. 8, there is shown a process flow diagram forobtaining estimates of polished rod position Xr, polished rod load Fr,and gearbox torque Tn derived from the motor current and voltage inaccordance with the invention. At startup, automatic identificationroutines are used offline to estimate various parameters. In oneembodiment, the automatic identification routines determine overall gearratio Ng and counterweight moment Mu for use in further calculations.The overall gear ratio is the difference between the motor revolutionsand the crank cycle. The automatic identification routines also are usedto establish motor equivalent circuit parameters as well as installationdependent pumping unit parameters, such as static friction torque Sf andviscous friction factor Bf.

[0099] Referring also to FIG. 3, after initialization, block 93 obtainsthe instantaneous values of motor stator current and motor statorvoltage from sensors 50 and 52, respectively. As described above, blocks62 and 63 respond to the motor current and voltage signals from thesensors 50 and 52 for use in calculating motor torque and velocity.Motor stator current and voltage are measured continuously allowing theinstantaneous values of current and voltage to be obtained through themeasurement.

[0100] In block 94, the values of instantaneous motor current and motorvoltage obtained from the measurements are used to derive electricaltorque Te. In one embodiment, the stator flux is derived from the motorcurrents and voltages, using equation (2) as described above. Theelectrical torque Te can be directly estimated from this stator flux andthe motor current measured, using equation (3).

[0101] In block 95, the values of instantaneous motor current and motorvoltage obtained from the measurements are used to derive motor velocityWr. In one embodiment, rotor flux is obtained from the measured voltageand current, and stator resistance and inductance, using equations (4)and (5) as has been described. Then, slip frequency is derived from therotor flux, the measured motor current, magnetizing inductance, rotorinductance, and rotor resistance using equation (6). An estimate ofelectrical frequency is derived from the stator flux using equation (7)as described above. Then, motor velocity Wr is derived from the slipfrequency and the electrical frequency using equation (8) as describedabove.

[0102] The motor velocity Wr obtained in block 95 is used to obtaincrank velocity Wc in block 96. In one embodiment, the crank velocity isobtained by scaling the motor velocity as described above with referenceto FIG. 3.

[0103] In block 98, the crank angle Ac is obtained by integrating thecrank velocity Wc obtained in block 96. A limit switch or similar devicemay be used to determine a reference point within the stroke of thepumping unit. The crank velocity Wc is integrated to get position thatcombined with the overall pumping unit gear ratio and reference positiongive the crank angle Ac.

[0104] In block 100, rod position Xr is calculated using the crank angleAc together with parameters associated with pumping unit geometry asdescribed above with reference to FIG. 3. The use of the systemparameters with crank angle Ac allows the calculation of rod positionXr.

[0105] In block 102, the gearbox torque Tn is calculated using theelectrical torque Te obtained from block 92. The overall gear ratio Ngis also used to compute gearbox output torque Tn from motor electricaltorque Te.

[0106] In block 104, the rotary weight torque Tr, is calculated by block67, the total reflected inertia Jt, is calculated by block 68, and motoracceleration Alpha is calculated by block 69.

[0107] In block 106, the combination of the system parameters andpumping unit geometry with electrical torque Te provides the computationof rod load Fr. The electrical torque estimate Te is used to obtain therod load estimate Fr.

[0108] The method of estimating the load and position of the polishedrod at the surface is possible without requiring down hole sensors,acoustic fluid level sensors, flow sensors, etc. The values of polishedrod load and position can be commonly plotted in XY format to produce asurface dynamometer card. The estimation method is a real-time,continuously updating method, i.e., it is not performed off-line in abatch manner. Moreover, the method of estimating a surface dynamometercard for a rod pump unit does not employ any load or positiontransducers.

[0109] In accordance with a further aspect of the invention, the valuesof polished rod load and position can be used to produce a downholedynamometer card estimate without the need for sensors. Referring toFIG. 13, there is shown a block diagram of a system 107 for obtaining adownhole dynamometer card without requiring down hole sensors, acousticfluid level sensors, flow sensors, etc., using the parameter estimator23 described above. The system 107 includes a downhole dynamometer cardestimator, block 108, that uses the polished rod position and thepolished rod load parameter values obtained by the parameter estimator23 to produce an estimation of the downhole dynamometer card. Thus, thedownhole dynamometer card estimation is produced without the need forrod position or load transducers. The motor voltage and current outputsignals obtained from measurements of the motor voltage and current areused to derive instantaneous values polished rod load and position whichare used in producing the estimated downhole dynamometer card.

[0110] The accuracy of the estimation of the downhole pump is dependentupon simulating damping forces that are inherent in sucker rod pumpsystems. A viscous damping coefficient is used to model these dampingforces.

[0111] More specifically, in one embodiment, an estimation of thedownhole dynamometer card is obtained using the wave equation to modelthe force trajectory along the rod string in distance and time. The waveequation is a linear hyperbolic differential equation that describes thelongitudinal vibrations of a long slender rod. Using the wave equationwith viscous damping, the motion of a sucker rod string can beapproximated. The wave equation is used only to model the rod string andforce travelling through it. The pump sets the boundary conditions forthe wave equation at the bottom and the surface prime mover sets theboundary conditions for the wave equation at the top. The continuousform of the wave equation with constant rod diameter is: $\begin{matrix}{{v^{2}\frac{\partial^{2}u}{\partial x^{2}}} = {\frac{\partial^{2}u}{\partial t^{2}} + {c\frac{\partial u}{\partial t}}}} & (9)\end{matrix}$

[0112] where u is the rod displacement, x is the axial distance alongthe length of the rod, c is the damping coefficient, and v is thevelocity of force propagation in the rods.

[0113] Details of the use of the wave equation in estimating a downholedynamometer card are disclosed, for example, in a paper entitled “AnImproved Finite-Difference Calculation of Downhole Dynamometer Cards forSucker-Rod Pumps”, by T. A. Everitt and J. W Jennings, SPE 18189, SPEProduction Engineering, February 1992, pages 121-127. For simplicity,Equation (9) is for the case of a constant rod diameter. However, asdisclosed in the referenced paper of T. A. Everitt and J. W Jennings,with modification, this method can also account for variable roddiameter, including tapered rod-strings and rod strings of variabledensity, e.g., steel or fiberglass. Solving the wave equation requiresonly two boundary conditions because only steady state solutions areneeded. The typical use of the wave equation would be to use sampleddata of a surface dynamometer card from a rod pumping systems to do anoff-line calculation of the pump downhole dynamometer card. In thisinvention, the wave equation is solved on-line for each data point sothe results can be used in the next sample period for control of thepumping system. The two boundary conditions are polished rod load Fr andposition Xr as a function of time. These conditions are produced by theparameter estimator 23.

[0114] The damping coefficient c can be similar to that presented by T.A. Everitt and J. W Jennings in the referenced paper, or that presentedin U.S. Pat. No. 3,343,409 issued to S. G. Gibbs.

[0115] The accuracy of the downhole dynamometer card estimate can beverified by performing simulations. One verification procedure that canbe used is similar to that disclosed in the paper by Everitt andJennings referenced above.

[0116] Using the multisection simulation disclosed in the paper by S. G.Gibbs, referenced above, the surface dynamometer card load is estimatedfrom a given surface position trajectory and pump load and position.This method computes new rod position estimates in time. Then, using thefinite difference method disclosed by Everitt and Jennings in the paperreferenced above, the downhole dynamometer card is estimated from thesurface dynamometer card generated previously. Then, the estimateddownhole dynamometer card is plotted with the predicted downholedynamometer card to verify the accuracy of the estimated downholedynamometer card.

[0117]FIG. 9 demonstrates the ability of the wave equation method toextract downhole pump operation from surface information. An assumedfull pump condition indicated by reference number 9-1 was used tosimulate surface dynamometer card parameters 9-3. Those parameters wereused with the wave equation method to generate the predicted downholepump dynamometer card 9-2 which closely tracks the originally assumedpump dynamometer card. FIG. 10 shows the results that were obtainedusing a commercially available simulation program to check the resultsof the multisection simulation and wave equation shown in FIG. 9

[0118] The foregoing simulations were conducted for a conventional beamtype rod pump. However, the finite difference method can be used forestimating the downhole dynamometer card for other types of rod pumpunits, such as a rod pump unit in which the driver includes a beltdrive. FIG. 11 shows results for a pumping unit including a belt that iscoupled to a rod string for reciprocating the rod string verticallywithin a well as the belt is driven by a motor. The graph given by FIG.11 includes a surface dynamometer card 11-1 obtained from actual fieldmeasure data and a predicted downhole dynamometer card 11-2 obtainedfrom the wave equation method. The source data was captured at aconstant pump velocity of four strokes per minute.

[0119]FIG. 12 illustrates results which are similar to those illustratedin FIG. 11 which were obtained using a commercially available simulationprogram.

[0120] The rod load Fr and/or rod position Xr parameters obtained usingthe parameter estimator can be used to provide various controlfunctions. By way of example, control algorithms can use the rod load,rod position, or both to achieve improved pump operation.

[0121] Referring to FIG. 14, there is shown a block diagram of a system130 for controlling a pump using rod load control. This controlalgorithm uses the rod load Fr, which can be from the estimator in FIG.3, along with maximum upper load and minimum lower load parameters toachieve desirable rod loading. Rod loads can be increased in areas ofthe pump cycle with low rod stress to increase pump stroke andassociated production and/or reduced in areas of the pump cycle withhigh rod stress to avoid rod damage.

[0122] When the torque factor Tf, which can be from the estimator inFIG. 3, is positive, the switch 135 causes the upper portion of thecontrol to be selected. Summing block 131 subtracts rod load Fr from thevalue Max_Upper_Load, which is determined during setup, and outputs theresult as Fue. If Fue is greater than zero, switch 133 causes it to bemultiplied by the above upper gain Kau in gain block 136. If Fue is lessthan or equal to zero, switch 133 causes it to be multiplied by thebelow upper gain Kbu in gain block 137.

[0123] Similarly, When the torque factor Tf is zero or negative, theswitch 135 causes the lower portion of the control to be selected.Summing block 132 subtracts the value Min_Lower_Load, which isdetermined during setup from rod load Fr, and outputs the result as Fle.If Fle is greater than zero, switch 134 causes it to be multiplied bythe above lower gain Kal in gain block 138. If Fle is less than or equalto zero, switch 134 causes it to be multiplied by the below lower gainKbl in gain block 138.

[0124] Whichever value is calculated is then multipled with the absolutevalue of torque factor Tf by multiplier block 141. The absolute value ofTf is derived by the absolute value block 140. The output of themultiplier block is added to the velocity request Wx by summing block142 to generate the velocity command Wy.

[0125] Referring to FIG. 15, there is shown the block diagram of asystem 110 wherein the rod load Fr parameter, which can be from theestimator in FIG. 3, can be used along with a one section model of therod string based on rod stiffness to provide a control function referredto hereinafter as a rod load damping control. This control dampens thestress excursions in the rod string and causes the downhole pump motionto more closely follow the motion of the polished rod at the surface.Therefore, efficiency and reliability of the pump system is increased.

[0126] Rod load Fr is divided by Rod_Stiffness, which is determinedduring setup, in division block 111. The result is differentiated byderivative function block 112 producing a velocity error term. If thetorque factor Tf, which can be from the estimator in FIG. 3, is greaterthan zero, switch block 117 causes the velocity error to be multipliedby the gain factor Kup in gain block 113 and then multiplied by thetorque factor Tf in multiplier block 114. If the torque factor Tf isless than or equal to zero, switch block 117 causes the velocity errorto be multiplied by the gain factor Kdn in gain block 115 and thenmultiplied by the torque factor Tf in multiplier block 116. The resultis then added to the velocity request Wx by summing block 118 togenerate the velocity command Wy.

[0127] Referring to FIG. 16, there is shown the block diagram of asystem 160, wherein the rod position Xr and rod load Fr parameters,which can be from the estimator in FIG. 3, can be used along with amultisection simulation model of the rod string to provide a controlfunction referred to hereinafter as a simulation model control.

[0128] Rod load Fr and rod position Xr are input to rod string modelblock 161. The rod string model simulates the rod behavior by dividingthe rod string into a finite number of elements. Each element has a massand spring constant. The dynamic effects of the changing rod load Fr androd position Xr are calculated on each section to determine the velocityof the downhole pump.

[0129] The rod velocity Vr, which can be from the estimator in FIG. 3,is subtracted from the pump velocity in summing block 162 to determinethe velocity error term. If the torque factor Tf, which can be from theestimator in FIG. 3, is greater than zero, switch block 167 causes thevelocity error to be multiplied by the gain factor Kup in gain block 163and then multiplied by the torque factor Tf in multiplier block 164. Ifthe torque factor Tf is less than or equal to zero, switch block 167causes the velocity error to be multiplied by the gain factor Kdn ingain block 165 and then multiplied by the torque factor Tf in multiplierblock 166. The result is then added to the velocity request Wx bysumming block 168 to generate the velocity command Wy.

[0130] Referring to FIG. 17, there is shown the block diagram of asystem 170, wherein the rod position Xr and rod load Fr parameters,which can be from the estimator in FIG. 3, can be used along with a waveequation model of the rod string to provide a control function referredto hereinafter as a wave equation control.

[0131] The wave equation control is a control algorithm capable ofdamping rod load oscillations, reducing rod stress, and increasing pumpstroke without changing the overall pumping speed, or in thealternative, maintaining the well output with decreased overall pumpingspeed. The wave equation control according to the invention increasesthe pump stroke, decreases peaks in rod load and dampens rod loadoscillations. However, average pumping speed is not affected. The waveequation control enables increased output in wells that are running atmaximum conventional capability of the pumping system.

[0132] The wave equation control manipulates motor velocity to maximizedownhole pump stroke. The control function provided by the wave equationcontrol basically consists of estimating pump velocity state by means ofa discrete rod string, fluid, and pump model. The pump velocity state isthen multiplied by a damping gain and summed with the request velocity.This lowers the rod load overshoot through active damping while alsoincreasing the downhole pump stroke. This results in an increase inoutput flow rate without an increase in overall average pumping speedwhich, in turn, increases well output without increasing overall pumpingspeed. This can provide increased output in wells that are running atmaximum capacity. Alternatively, a given well output can be maintainedwith decreased overall pumping speed.

[0133] More specifically, with reference to FIG. 17, the wave equationcontrol includes a rod string model 171 in which the rod load Fr and rodposition Xr can be from the parameter estimator of FIG. 3.

[0134] The wave equation control 170 employs a rod string model (i.e.,rod string model 171) that produces pump velocity Vp and pump positionXp states. However in one embodiment, only the pump velocity Vp is usedin the control function. Although pump position Xp is not used forcontrol, pump position can be used to estimate pump stroke Sp. The pumpstroke information, in turn, can be used to generate flow rateinformation.

[0135] The rod/pump simulation 171 responds to rod position Xr and rodload Fr and produces an output representative of simulated pump velocityVp.

[0136] The rod velocity Vr, which can be from the estimator in FIG. 3,is subtracted from the pump velocity in summing block 172 to determinethe velocity error term. If the torque factor Tf, which can be from theestimator in FIG. 3, is greater than zero, switch block 177 causes thevelocity error to be multiplied by the gain factor Kup in gain block 173and then multiplied by the torque factor Tf in multiplier block 174. Ifthe torque factor Tf is less than or equal to zero, switch block 177causes the velocity error to be multiplied by the gain factor Kdn ingain block 175 and then multiplied by the torque factor Tf in multiplierblock 176. The result is then added to the velocity request Wx bysumming block 178 to generate the velocity command Wy.

[0137] Referring to FIG. 18, there is shown a process flow diagram forproducing simulation model control and wave equation control inaccordance with the invention. Block 150 obtains the polished rodposition Xr. This can be done using the algorithm as described abovewith reference to FIG. 3.

[0138] Block 152 obtains the polished rod velocity Vr. This can be doneusing the algorithm as described above with reference to FIG. 3.

[0139] The downhole pump velocity Vp is obtained in block 154. This isobtained using the rod string model 161 for the simulation model controlor 171 for the wave equation control.

[0140] Then, the difference of the surface rod velocity Vr and thedownhole pump velocity Vp is obtained in block 156 by subtracting thepump velocity from the polished rod velocity, as shown by summing blocks162 and 172.

[0141] The modulating factor is created in block 158 by applying thedamping difference between the surface rod velocity and the pumpvelocity to the proportional gain amplifiers selected from 163, 165, 173and 175 by switch blocks 167 and 177 and then multiplying by the torquefactor Tf in blocks 164, 166, 174 and 176.

[0142] The modulating factor is combined with the velocity request Wx bysumming blocks 168 and 178 to produce a command velocity Wy for thedrive motor 32. The velocity command Wy signal varies as a function ofthe change in rod velocity Vr relative to pump velocity Vp.

[0143] FIGS. 19-24 illustrate results of a beam pump running with andwithout the simulation model control algorithm enabled. Referringinitially to FIGS. 19 and 20, there is shown a surface dynamometer cardfor a pump running without simulation model control and with simulationmodel control, respectively. The data is that for a beam pump running atseven strokes per minute.

[0144] As can be seen by comparing the dynamometer card in FIG. 19 withthe dynamometer card shown in FIG. 20, with the simulation model controlenabled, the rod stress fluctuation is reduced by lowering the peak rodup stroke load while the raising minimum rod down stroke load. Forexample, the dynamometer card in FIG. 19 shows a peak rod load of about36,000 pounds while the dynamometer card in FIG. 20 shows a peak rodload of about 33,000 pounds. In addition, the dynamometer card in FIG.19 shows a minimum rod load of about 13,000 pounds while the dynamometercard in FIG. 20 shows a minimum rod load of about 16,000 pounds. Rodload oscillation is dampened as can be seen by comparing FIG. 19 withFIG. 20. Rod load fluctuation of 17,000 (33,000-16,000) pounds with rodpump control is 26% less then the 23000 (36,000-13,000) pounds withoutsimulation model control.

[0145]FIGS. 21 and 22 show the downhole pump dynamometer cardsassociated with FIG. 19 and FIG. 20 respectively. As can be seen bycomparing the dynamometer card in FIG. 21, without simulation modelcontrol, with the dynamometer card shown in FIG. 22, with the simulationmodel control, the pump stroke has increased from 255 inches to 282inches. This 27 inch difference translates to an increase in fluidproduction of nearly 11%.

[0146] Additional advantages of simulation model control can be seen bycomparing the graphs in FIGS. 23 and 24. Graphs in those figures showmotor velocity Wr, pump velocity Vp, and rod velocity Vr. Withoutsimulation model control, FIG. 23, the pump velocity reaches peak valuesthat are nearly twice that of the polished rod and considerable time isspent dwelling at zero velocity. When simulation model control isenabled, FIG. 24, the peak pump velocity more nearly tracks polished rodvelocity and no time is wasted dwelling at zero velocity. This providesfor increased pump stroke without the need for high pump peak speeds.

[0147] In this example, pump stroke is increased approximately 11% withno overall change in average pumping unit speed. In addition, peak rodload is reduced, minimum rod load is increased, rod load oscillation isdampened, and peak pump velocity is reduced.

[0148] Referring to FIG. 25, in one preferred embodiment, the systemprovided by the present invention, is software based and is capable ofbeing executed in a processor 53 shown in block diagram form in FIG. 25.In one embodiment, the computer system includes input devices 181, suchas current and voltage sensors connected to analog to digitalconverters, output devices 182, such as, a variable frequency drive, anda processing unit 55 having associated random access memory (RAM) andread-only memory (ROM). In one embodiment, the storage devices include adatabase 185 and software programs and files which are used in carryingout simulations of circuits and/or systems in accordance with theinvention. The programs and files of the computer system include anoperating system 186, the parameter estimation engine 187, and a controlmethod 188 such as the simulation model control engine, rod load controlengine, rod load damping control engine or wave equation control engine,for example. The programs and files of the computer system can alsoinclude or provide storage for data. The processor is connected throughsuitable input/output interfaces and internal peripheral interfaces (notshown) to the input devices, the output devices, the storage devices,etc., as is known.

[0149] Although an exemplary embodiment of the present invention hasbeen shown and described with reference to particular embodiments andapplications thereof, it will be apparent to those having ordinary skillin the art that a number of changes, modifications, or alterations tothe invention as described herein may be made, none of which depart fromthe spirit or scope of the present invention. All such changes,modifications, and alterations should therefore be seen as being withinthe scope of the present invention.

What is claimed is:
 1. A method of continuously determining operatingparameters of a rod pump used in oil or gas production, the rod pumpincluding a rod string carrying a downhole pump and a drive systemincluding an AC electrical drive motor having a rotor coupled to the rodstring through a transmission unit, the rod string including a polishedrod, said method comprising the steps of: determining values of torqueand velocity inputs to the pump; using the torque and velocity values tocalculate one or more values representing the performance of the pump;and using values of parameters related to the geometry of the rod pumpand at least one of said performance values to calculate values of anoperating parameter of the rod pump.
 2. The method according to claim 1,wherein determining the torque and velocity values includes continuouslymeasuring electrical voltage applied to the drive motor and electricalcurrent drawn by the drive motor, and using the measured values ofelectrical voltage applied to the motor and electrical current drawn bythe motor to calculate at least one value for a parameter selected fromthe group consisting of motor torque and motor velocity.
 3. The methodaccording to claim 1, wherein said operating parameter is polished rodposition, and wherein calculating said operating parameter includes thesteps of deriving a crank angle value from the motor velocity values,and using the crank angle value in calculating values of the position ofthe polished rod.
 4. The method according to claim 3, wherein derivingthe crank angle value includes integrating with respect to time, themotor velocity values to get a value indicative of a position which,when combined with an overall gear ratio of a gearbox of thetransmission unit and a reference position produces a valuecorresponding to the angular position of an output crankshaft of thetransmission unit.
 5. The method according to claim 1, wherein saidoperating parameter is polished rod load, and wherein calculating thevalues of said operating parameter includes the steps of deriving acrank angle value from the motor velocity values, and using the crankangle value and the values of electrical torque in calculating values ofpolished rod load.
 6. The method according to claim 5, including usingthe values of parameters representing the geometry or the rod pumptogether with the crank angle value to calculate a torque factor.
 7. Themethod according to claim 5, including using the overall gear ratio ofthe transmission unit to calculate from the electrical torque value, theoutput torque of the transmission unit.
 8. The method according to claim5, including the steps of: using the parameter values related to thegeometry of the rod pump and motor velocity values to derive a value ofrotary weight torque for the crankshaft; using parameter valuesrepresenting the geometry of the rod pump and a torque factor derivedfrom the parameter values representing the geometry of the rod pump andthe crank angle to calculate a value of load inertia for the drivemotor; deriving from the motor velocity values, values of instantaneousacceleration of a rotor of the drive motor; and using the rotary weighttorque value, the load inertia value, the motor acceleration values, thetorque factor, the electrical torque value and at least onecharacteristic value of the rod pump to calculate instantaneous load forthe polished rod.
 9. The method according to claim 8, wherein derivingthe rotary weight torque value includes the steps of combining the crankangle value and a counterweight angle value to produce an angularposition value; and multiplying the angular position value by a factorrelated to rotary weight.
 10. The method according to claim 8, whereincalculating the load inertia value includes the steps of combining thetorque factor and a value corresponding to the weight of the beam weightat the polished rod to produce an inertia value, combining the inertiavalue with a value indicative of the inertia of a counterweight of therod pump, and combining the result with a value corresponding to theinertia of the rotor of the drive motor.
 11. The method according toclaim 8, wherein deriving the acceleration value includesdifferentiating the motor velocity value with respect to time.
 12. Themethod according to claim 1, wherein deriving the torque values includesobtaining an estimate of a value of stator flux, and using the statorflux estimate value and the measured current to calculate the torquevalue.
 13. The method according to claim 1, wherein determining themotor velocity values includes obtaining an estimate of electricalfrequency, obtaining an estimate of slip frequency, and using theestimated values of electrical frequency and slip frequency and themeasured current to obtain the motor velocity value.
 14. The methodaccording to claim 5, wherein the first and second operating parametersare instantaneous position and load of the polished rod, and furtherincluding using the estimated values of position and load for thepolished rod to obtain a surface dynamometer card for the rod pump, andderiving from the surface dynacard a downhole dynamometer card for therod pump.
 15. The method according to claim 14, wherein deriving thedownhole dynamometer card includes using a wave equation to model theforce trajectory along the rod string in distance and time, and whereinboundary conditions for the wave equation include polished rod load anddisplacement as a function of time.
 16. A method of continuouslydetermining rod position and rod load for a rod of a rod pump used inoil and gas production for use in real-time control of the rod pump, therod pump including a rod string, and a drive system including an ACelectrical motor having a rotor coupled to the rod string through atransmission unit for reciprocating a downhole pump, the rod stringincluding a polished rod, said method comprising the steps of:continuously measuring the voltage applied to the drive motor to producean electrical voltage output signal; continuously measuring the currentapplied to the drive motor to produce an electrical current outputsignal; deriving values of instantaneous electrical torque from theelectrical voltage output signal and the electrical current outputsignal; deriving values of instantaneous motor velocity from theelectrical voltage output signal and the electrical current outputsignal; determining a crank angle position for the motor; using valuesof parameters related to geometry of the rod pump to calculate valuesfor instantaneous positions of the polished rod for related angularpositions of the crank; and using at least the crank velocity value andat least one of the electrical torque values to produce an instantaneousvalue of the load of the polished rod.
 17. The method according to claim16, including the steps of: using values of parameters related thegeometry of the rod pump and the motor velocity values to derive a valueof rotary weight torque for the crankshaft; using values related to thegeometry of the rod pump and a torque factor derived from the geometryof the rod pump and the crank angle to obtain a value of load inertiafor the drive motor; deriving from the motor velocity values, values ofinstantaneous acceleration of the rotor of the drive motor; and usingthe rotary weight torque value, the load inertia value, the motoracceleration values, the torque factor, the electrical torque value andat least one characteristic value of the rod pump to calculateinstantaneous load for the polished rod.
 18. The method according toclaim 17, wherein calculating the rotary weight torque includes thesteps of combining the crank angle value and a counterweight angle toproduce an angular position value; and multiplying the angular positionvalue by a factor related to rotary weight.
 19. The method according toclaim 17, wherein calculating the load inertia value includes the stepsof combining the torque factor and a value corresponding to the weightof the beam weight at the polished rod to produce an inertia value,combining the inertia value with a value indicative of the inertia of acounterweight of the rod pump, and combining the result with a valuecorresponding to the inertia of the rotor of the drive motor.
 20. Themethod according to claim 17, wherein deriving the acceleration valueincludes differentiating the motor velocity value with respect to time.21. The method according to claim 16, wherein obtaining the electricaltorque values includes obtaining an estimate of a value of stator flux,and using the stator flux estimate value and the electrical currentoutput signal to obtain the electrical torque value.
 22. The methodaccording to claim 16, wherein obtaining the motor velocity valuesincludes obtaining an estimate of electrical frequency, obtaining anestimate of slip frequency, and using the estimated values of electricalfrequency and slip frequency and the electrical current output signal toobtain the motor velocity value.
 23. The method according to claim 16,and further including using the estimated values of position and loadfor the polished rod to obtain a surface dynamometer card for the rodpump, and deriving from the surface dynamometer card a downholedynamometer card for the rod pump.
 24. A method of optimizing theperformance of a rod pump used for transferring fluid within a fluidsystem, the rod pump including a rod string carrying a downhole pump,and a variable drive coupled to the rod string for reciprocating the rodstring within the fluid system, the method comprising the steps of:determining torque and velocity inputs to the rod pump; using the torqueand velocity inputs to calculate values for one or more operatingparameters for the rod pump; using one or more of the operatingparameter values to produce command signals; and using the commandsignals to vary the velocity of the downhole pump to cause the downholepump to closely follow the polished rod position while limiting tensileand compressive forces excursions in rod load as the rod string is beingreciprocated.
 25. The method according to claim 24, wherein determiningtorque and velocity inputs includes the steps of: measuring electricalvoltage applied to a drive motor of the variable drive and electricalcurrent drawn by the drive motor; and using the measured values ofelectrical voltage and current to calculate values of motor torque andmotor velocity for the drive motor.
 26. A method of controlling theperformance of a rod pump used for transferring fluid within a fluidsystem, the rod pump including a rod string carrying a downhole pump,the rod string including a polished rod, the method comprising the stepsof: determining values of torque and velocity inputs to the pump; usingthe torque and velocity values to calculate values for one or moreoperating parameters for the rod pump; using one or more of theoperating parameter values to produce command signals; and using thecommand signals to vary the velocity of the pump to at least limitexcursions in rod load to preset limits.
 27. The method according toclaim 26, wherein the operating parameters include at least one of rodload, rod position and rod velocity.
 28. The method according to claim26, wherein using the operating parameter values to produce commandsignals includes the steps of obtaining a value representing rod load;obtaining a value representing rod position; using the values of rodload and rod position to obtain an estimate of the velocity of thedownhole pump; and using the difference between the rod velocity and thedownhole pump velocity in producing the command signals.
 29. The methodaccording to claim 27, wherein using the operating parameter values toproduce command signals includes the step of obtaining an estimate ofvelocity of the downhole pump using at least the value of rod load. 30.The method according to claim 29, wherein obtaining an estimate ofvelocity of the downhole pump includes using at least rod load alongwith a simulation model to predict the velocity of the downhole pump.31. The method according to claim 30, wherein the simulation model isbased on a multi-section model of the rod string.
 32. The methodaccording to claim 30, wherein the simulation model is based on a waveequation model of the rod string.
 33. The method according to claim 30,wherein the simulation model is based on a single section model of therod string.
 34. The method according to claim 27, wherein using theoperating parameter values to produce command signals includes the stepsof using one or more of the operating parameter values to calculate avalue representing rod load and comparing the rod load value with presetupper and lower load limit values.
 35. The method according to claim 26,wherein determining torque and velocity inputs includes the steps of:measuring electrical voltage applied to a drive motor of the variabledrive and electrical current drawn by the drive motor; and using themeasured values of electrical voltage and current to calculate values ofmotor torque and motor velocity for the drive motor.
 36. A method ofcontrolling the performance of a rod pump used for transferring fluidwithin a fluid system, the rod pump including a rod string carrying adownhole pump, and a variable drive including an electrical drive motorcoupled to the rod string for reciprocating the rod string; the methodcomprising the steps of: measuring electrical voltage applied to thedrive motor and electrical current drawn by the drive motor; using themeasured values of electrical voltage applied to the drive motor andcurrent drawn by the drive motor to calculate values of motor torque andmotor velocity for the drive motor; using the values of motor torque andmotor velocity to calculate values representing operating parameters forthe rod pump; using one or more of the operating parameter values toproduce command signals; and using the command signals to vary thevelocity of the downhole pump to cause the downhole pump to closelyfollow the polished rod position while limiting tensile and compressiveforces excursions in rod load as the rod string is being reciprocated.37. The method according to claim 36, wherein the operating parametersinclude at least one of rod load, rod position and rod velocity.
 38. Themethod according to claim 36, wherein using the operating parametervalues to produce command signals includes the steps of obtaining avalue representing rod load; obtaining a value representing rodposition; using the values of rod load and rod position to obtain anestimate of the velocity of the downhole pump; and using the differencebetween the rod velocity and the downhole pump velocity in producing thecommand signals.
 39. The method according to claim 37, wherein using theoperating parameter values to produce command signals includes the stepof obtaining an estimate of velocity of the downhole pump using at leastthe value of rod load.
 40. The method according to claim 39, whereinobtaining an estimate of velocity of the downhole pump includes using atleast rod load along with a simulation model to predict the velocity ofthe downhole pump.
 41. The method according to claim 40, wherein thesimulation model is based on a multi-section model of the rod string.42. The method according to claim 40, wherein the simulation model isbased on a wave equation model of the rod string.
 43. The methodaccording to claim 40, wherein the simulation model is based on a singlesection model of the rod string.
 44. The method according to claim 37,wherein using the operating parameter values to produce command signalsincludes the steps of using one or more of the operating parametervalues to calculate a value representing rod load and comparing the rodload value with preset upper and lower load limit values.
 45. A pumpcontrol system for controlling the performance of a rod pump used fortransferring fluid within a fluid system, the rod pump including a rodstring carrying a downhole pump that is reciprocated, the pump systemcomprising: means for determining values of torque and velocity inputsto the pump; means for using the torque and velocity values to calculatevalues for one or more operating parameters for the rod pump; means forusing one or more of the operating parameter values to produce commandsignals for controlling the pump to vary the velocity of the pump tolimit excursions in rod load to preset limits.
 46. The pump controlsystem according to claim 45, wherein the means for using the operatingparameter values to produce command signals includes means for obtaininga value representing rod load; means for obtaining a value representingrod position; means for using the values of rod load and rod position toobtain an estimate of the velocity of the downhole pump; and means forusing the difference between the rod velocity and the downhole pumpvelocity in producing the command signals.
 47. The pump control systemaccording to claim 46, including a simulation model for obtaining anestimate of velocity of the downhole pump.
 48. The pump control systemaccording to claim 47, wherein the simulation model is based on amulti-section model of the rod string.
 49. The pump control systemaccording to claim 47, wherein the simulation model is based on a waveequation model of the rod string.
 50. The pump control system accordingto claim 47, wherein the simulation model is based on a single sectionmodel of the rod string.
 51. The pump control system according to claim45, wherein the means for using the operating parameter values toproduce command signals includes means for using one or more of theoperating parameter values to calculate a value representing rod loadand means for comparing the rod load value with preset upper and lowerload limit values.
 52. The pump control system according to claim 45,wherein determining torque and velocity inputs includes the steps of:measuring electrical voltage applied to a drive motor of the variabledrive and electrical current drawn by the drive motor; and using themeasured values of electrical voltage and current to calculate values ofmotor torque and motor velocity for the drive motor.
 53. The pumpcontrol system according to claim 45, wherein the means for determiningtorque and velocity inputs to the pump includes sensors for measuringthe electrical voltages applied to the motor and currents drawn by themotor and means for using the measured values of electrical voltagesapplied to the motor and currents drawn by the motor to calculate valuesof torque and velocity produced by the motor.
 54. A system forcontinuously determining operating parameters of a rod pump used in oilor gas production, the rod pump including a rod string carrying adownhole pump driven by an electrical drive motor that is coupled to therod string through a transmission unit, the system comprising: means fordetermining values of torque and velocity inputs to the rod pump; meansfor using the torque and velocity values to calculate one or more valuesrepresenting the performance of the rod pump; and means for usingparameter values related to the geometry of the rod pump and at leastone of said performance values to calculate values of at least oneoperating parameter of the rod pump.